package com.itheima.jsonDemo;

import com.alibaba.fastjson.JSON;

/**
 * @author tongchen
 * @create 2022-12-02 17:11
 */
public class JsonDemo {
    public static void main(String[] args) {
        /*//1.导入对象
        User user = new User();
        user.setId(1);
        user.setUsername("张三");
        user.setPassword("123");
        //2.new json\
        String s = JSON.toJSONString(user);
        System.out.println(s);
        //3.将字符串转化为json对象
        User user1 = JSON.parseObject("{\"id\":1,\"password\":\"123\",\"username\":\"张三\"}", User.class);
        System.out.println(user1);*/

    }
}
